\documentclass[a4paper,11pt]{article}

\newcommand{\email}[1]{{\tt [{#1}]}}

\title{{\tt libifx2f}: A Fortran90 client API to access IBM Informix databases}
\author{Jo\~ao Batista \email{jmn.batista@gmail.com}}
\date{\today}

\begin{document}
\maketitle

\section{Introduction}
{\tt libifx2f} is a project, originally developed for the Portuguese Instituto de Meteorologia \cite{URLmeteopt}, to provide a basic Fortran90 API for inserting and selecting rows into existing IBM Informix database tables. 

\section{Compilation}
Compilation requirements:
\begin{enumerate}
\item IBM Informix CSDK \cite{URLcsdk}
\item gfortran \cite{URLgfortran}
\item cfortran.h \cite{URLcfortran}
\item GNU tools (make \cite{URLmake}, etc.) 
\end{enumerate}
To compile the library file, {\tt libifx2f.so}, type:
\begin{center}\tt make lib\end{center}
or
\begin{center}\tt make libifx2f.so\end{center}
You must have the Informix client libraries (CSDK) already installed appropriately for this to succeed. To specify where the Informix client software is installed (see the {\tt Makefile} file), type 
\begin{center}\tt INFORMIXDIR=\textit{/alternate/informix/base/path} make libifx2f.so\end{center}
To compile the Debian package, run:
\begin{center}\tt debuild -us -uc\end{center}
Note: you must have the Informix client libraries (CSDK) installed prior to do this! Edit the {\tt debian/control} file for the correct dependencies.\footnote{At this time, IBM does not provide Debian packaging of the CSDK.}

\section{Runtime requirements}
Runtime requirements:
\begin{enumerate}
\item {\tt libgfortran} runtime libraries
\item IBM Informix CSDK runtime (client) libraries
\item Setting up Informix client environment (see the Environment Variables page\footnote{\tt http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.sqlr.doc/sqlrmst172.htm} on the IBM Informix SQL manual\footnote{\tt http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.sqlnode.doc/sql.htm}):
\begin{itemize}
\item \verb|INFORMIXDIR=/opt/informix| (or whatever is the base installation of the Informix CSDK in your system).
\item \verb|INFORMIXSERVER=imdev_soc| (for example).
\item \verb|INFORMIXSQLHOSTS=$HOME/.sqlhosts| (or alternate location for this file). 
\end{itemize}
\end{enumerate}

You can setup the library by running
\begin{center}\tt source config/libifx2f.conf\end{center}
(assuming you are in the current directory of {\tt libifx2f.conf}).

\subsection{Example \$HOME/.sqlhosts}
This assumes that the Informix database server is running on a machine named nebulosa, and which the Informix CSDK recognizes as \verb|imdev_soc|.
\begin{verbatim}
# This is $HOME/.sqlhosts
#dbservername  nettype   hostname   servicename  options
#------------- --------- ---------- ------------ ----------
imdev_soc      onsoctcp  localhost  1526

# $HOME/.sqlhosts ends
\end{verbatim}

\section{Examples}
Run
\begin{center}\tt make -C examples\end{center}
to compile the example programs in that directory (this assumes that {\tt libifx2f.so} is in the current directory).

\begin{thebibliography}{99}
\bibitem{URLmeteopt} Instituto de Meteorologia, I.P. URL: \verb|http://www.meteo.pt|
\bibitem{URLcsdk} The IBM Informix CSDK 3.50 Linux 64-bit RedHat package. URL: {\tiny \verb|www14.software.ibm.com/webapp/download/preconfig.jsp?id=2007-11-01+10%3A22%3A53.971073R&S_TACT=104CBW71&S_CMP=|}
\bibitem{URLgfortran} GNU Fortran compiler (gfortran). URL: \verb|http://gcc.gnu.org/wiki/GFortran|
\bibitem{URLcfortran} B.~D.~Steinmacher-Burow. \textit{cfortran.h: Interfacing C or C++ and FORTRAN}. URL: \verb|http://www-zeus.desy.de/~burow/cfortran|
\bibitem{URLmake} GNU Make. URL: \verb|http://www.gnu.org/software/make/|
\end{thebibliography}

\end{document}
